package com.education.welco.mapper;

import com.education.welco.pojo.dto.LearningStatisticsDto;
import com.education.welco.pojo.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * zcp
 * 试卷分析
 * 2022/10/21
 */
@Repository
public interface OrderPaperAnalysisMapper {

    List<OrderPaperAnalysisVO> selectAllUserPaperByPaperId(Integer paperId);

    List<OrderPaperAnalysisVO> paperQuestionType(Integer paperId);

    List<OrderPaperAnalysisVO> fallibleQuestionTop(Integer paperId);

    List<QuestionForAnalysisVo> selectOrderQuestionByPaperId(Integer paperId);

    List<OrderPaperAnalysisVO> selectOrderAnswer(@Param("paperId") Integer paperId,
                                                 @Param("list") List<QuestionForAnalysisVo> list);

    Integer videoDuration(@Param("courseId") Integer courseId, @Param("classId") Integer classId);

    Integer numberOfParticipants(@Param("courseId") Integer courseId, @Param("classId") Integer classId);

    Integer getStudyOverCount(@Param("courseId") Integer courseId, @Param("classId") Integer classId,
                              @Param("timeLimit") int timeLimit);

    Integer getCourseVideoNum(@Param("courseId") Integer courseId, @Param("classId") Integer classId);

    Integer getStuNum(@Param("courseId") Integer courseId, @Param("classId") Integer classId);

    List<StudyAnalysisVo> getStudentScore(@Param("courseId") Integer courseId,
                                          @Param("classId") Integer classId);

    /**
     * 查询课堂关联的课程id
     *
     * @param courseId
     * @param classId
     * @return
     */
    List<Integer> getCatalogIdList(@Param("courseId") Integer courseId, @Param("classId") Integer classId);

    List<StudyAnalysisVo> getPaperPassScore(@Param("list") List<Integer> catalogIdList);

    Integer getVideoCount(@Param("courseId") Integer courseId,
                          @Param("classId") Integer classId);

    List<StudyAnalysisVo> everyOneProgress(@Param("courseId") Integer courseId,
                                           @Param("classId") Integer classId,
                                           @Param("videoCount") Integer videoCount,
                                           @Param("timeLimit") int timeLimit);

    List<EchartsVO> getPaperStuNum(StudyAnalysisParamVo paramVo);

    List<StudyAnalysisVo> getPaperStuProgress(StudyAnalysisParamVo paramVo);

    List<EchartsVO> getVideoStuNum(@Param("param") StudyAnalysisParamVo paramVo, @Param("timeLimit") int timeLimit);

    List<StudyAnalysisVo> getVideoStuProgress(@Param("param") StudyAnalysisParamVo paramVo,
                                              @Param("timeLimit") int timeLimit,
                                              @Param("ifLearn") Integer ifLearn);

    List<StudyAnalysisVo> getAllStu(@Param("param") StudyAnalysisParamVo paramVo,
                                    @Param("studentIdList") List<Integer> studentIdList);

    List<Integer> getPaperIdList(StudyAnalysisParamVo paramVo);

    List<EchartsVO> selectQuestionTop(@Param("param") StudyAnalysisParamVo paramVo,
                                      @Param("userPaperIdList") List<Integer> userPaperIdList);

    Integer selectQuestionTopCount(@Param("param") StudyAnalysisParamVo paramVo,
                                   @Param("userPaperIdList") List<Integer> userPaperIdList);

    List<EchartsVO> talkTop(StudyAnalysisParamVo paramVo);

    Long getDurationVideoByUserId(LearningStatisticsDto paramVo);

    LearningStatisticsVO getDurationPaperByUserId(LearningStatisticsDto paramVo);

    List<LearningStatisticsAVO> wrongQuestionRanking(LearningStatisticsDto paramVo);

    List<LearningStatisticsCVO> correctQuestionsRanking(LearningStatisticsDto paramVo);

    LearningStatisticsCVO oneselfRanking(LearningStatisticsDto paramVo);

    List<LearningStatisticsEVO> accuracyRanking(LearningStatisticsDto paramVo);

    LearningStatisticsEVO oneselfAccuracyRanking(LearningStatisticsDto paramVo);

    List<LearningStatisticsDVO> exerciseDurationRanking(LearningStatisticsDto paramVo);

    LearningStatisticsDVO oneselfExerciseDurationRanking(LearningStatisticsDto paramVo);

    List<LearningStatisticsBVO> wrongTitleBook(LearningStatisticsDto paramVo);

    Map<String, Object> getUserPaperInfo(@Param("paperId") Integer paperId,
                                         @Param("stuNum") Integer stuNum,
                                         @Param("passScore") BigDecimal passScore);

    Map<String, Object> numberOfPeopleDivided(Integer paperId);

    float getAvgScore(StudyAnalysisParamVo paramVo);

    List<Integer> getUserPaperIdList(StudyAnalysisParamVo paramVo);
}
